package com.freelancer.musicinstruction.activity;

import java.util.Set;

import com.freelancer.musicinstruction.R;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class YoutubeDetailsPage extends Activity {
	
	protected static final String TAG = YoutubeDetailsPage.class.getSimpleName();
	TextView videoTitleLabel;
	Button watchVideoButton;
	String video_id;
	String video_title;
	String video_url;
	Bundle details;
	
	@Override
    public void onCreate(Bundle savedInstanceState){
		
		super.onCreate(savedInstanceState);
        setContentView(R.layout.youtube_details);
        
        details = getIntent().getExtras();
        
        video_id = details.getString( "video_id" );
        video_title = details.getString( "video_title" );
        video_url = details.getString( "video_url" );
        
        videoTitleLabel = (TextView)findViewById( R.id.video_title);
        watchVideoButton = (Button)findViewById( R.id.watch_video );
        
        videoTitleLabel.setText( video_title );
        
        watchVideoButton.setOnClickListener( new OnClickListener(){

			@Override
			public void onClick(View view) {

				Intent watchVideo = new Intent( YoutubeDetailsPage.this, YoutubeVideoPage.class );
				watchVideo.putExtras( details );
				
				startActivity( watchVideo );
			}
        	
        });
	}
}
